/**
 * 2017年4月25日
 */
package util.tags;

import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 * @author Alex
 *
 */
public class BaseTag extends SimpleTagSupport{
	protected PageContext pageContext;
	protected ServletRequest request; 
	@Override
	public void setJspContext(JspContext pc) {
		super.setJspContext(pc);
		this.pageContext = (PageContext) pc;
		this.request = this.pageContext.getRequest();
		
	}
	
	protected Object getAttribute(String attName){
		Object o = this.pageContext.getAttribute(attName);
		return o==null?this.request.getAttribute(attName):o;
		
	}
}
